<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>WebRTC Stream</title>
</head>

<body>
  <!-- <video style="width: 640px;height: 360px;" id="video" muted="false" autoplay playsinline /> -->
  <video style="width: 70%;height: auto;" id="video" muted="false" autoplay playsinline />
  <script src="https://cdn.jsdelivr.net/npm/socket.io-client@4.7.5/dist/socket.io.min.js"></script>
  <script src="libs/adapter.min.js"></script>
  <script src="webrtcstreamer.js"></script>

  <script>
    var webRtcServer = null;
    window.onload = function () {
      // 本地测试
      webRtcServer = new WebRtcStreamer("video", location.protocol + "//" + location.hostname + ":3000");

      // 动画 rtsp://rtspstream:0e606c38dc28122cb26ffc1337c057a3@zephyr.rtsp.stream/movie
      // webRtcServer.connect("rtsp://rtspstream:0e606c38dc28122cb26ffc1337c057a3@zephyr.rtsp.stream/movie", null, 'rtptransport=tcp&timeout=60'); 

      // Waterford 沃特福德（爱尔兰东南部港市） 
      // webRtcServer.connect("rtsp://86.44.41.160/axis-media/media.amp", null, 'rtptransport=tcp&timeout=60');

      // VyhladJazero 湖泊
      webRtcServer.connect("rtsp://stream.strba.sk:1935/strba/VYHLAD_JAZERO.stream", null, 'rtptransport=tcp&timeout=60');
      // webRtcServer.connect("rtsp://stream.strba.sk:1935/strba/VYHLAD_JAZERO.stream");

      // Bayonne 巴约讷（法国西南部城市)
      // webRtcServer.connect("rtsp://193.142.128.20/axis-media/media.amp", null, 'rtptransport=tcp&timeout=60');

      // PriceCenterPlaza 价格中心广场（英国伦敦市）
      // webRtcServer.connect("rtsp://132.239.12.145/axis-media/media.amp", null, 'rtptransport=tcp&timeout=60');

      // Norwich 诺丁汉（英国北爱尔兰南部城市）
      // webRtcServer.connect("rtsp://37.157.51.30/axis-media/media.amp", null, 'rtptransport=tcp&timeout=60');
    }

    window.onbeforeunload = function () { webRtcServer.disconnect(); }
  </script>
</body>

</html>